package com.ruoyi.lowcode.runner;

import com.ruoyi.lowcode.service.ILcDatabaseSourceService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * 初始化 lowcode 模块对应业务数据
 *
 * @author Lion Li
 */
@Slf4j
@RequiredArgsConstructor
@Component
public class LowCodeApplicationRunner implements ApplicationRunner {

    private final ILcDatabaseSourceService databaseSourceService;

    @Override
    public void run(ApplicationArguments args) throws Exception {

        databaseSourceService.loadingDatabaseSourceCache();
        log.info("加载数据源缓存数据成功");
    }

}
